import json
import os
import traceback

import pymysql


def get_conn():
    # 1、连接
    # conn = pymysql.connect(host="www.wenbaizhi.top",
    #                        user='root',
    #                        passwd="mysql",
    #                        port=13306,
    #                        db='shane_qa',
    #                        charset="utf8mb4"
    #                        )
    conn = pymysql.connect(host="192.168.1.101",
                           user='root',
                           passwd="mysql",
                           port=3306,
                           db='shane_qa',
                           charset="utf8mb4"
                           )

    # 2、生成游标
    cur = conn.cursor()
    return conn, cur